<div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <vc:i18n name="添加授权" namespace="addLockPerson"></vc:i18n>
                    </h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-white btn-sm" v-on:click="vc.goBack()">
                            <i class="fa fa-close"></i>返回
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <div>
                        <div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right">
                                    <vc:i18n name="门锁设备" namespace="addLockPerson"></vc:i18n>
                                </label>
                                <div class="col-sm-9">
                                    <select class="custom-select" v-model="addLockPersonInfo.machineId">
                                        <option selected disabled value="">{{vc.i18n('必填，请选择门锁','addLockPerson')}}</option>
                                        <option v-for="(item, index) in lockMachineList" :key="index" :value="item.machineId">
                                            {{item.machineName}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right">
                                    <vc:i18n name="业主" namespace="addLockPerson"></vc:i18n>
                                </label>
                                <div class="col-sm-8">
                                    <input v-model="addLockPersonInfo.name" disabled type="text" :placeholder="vc.i18n('必填，请选择业主','addLockPerson')" class="form-control">
                                </div>
                                <div class="col-sm-1">
                                    <button type="button" class="btn btn-primary btn-sm" v-on:click="_openChooseOwner()">选择业主</button>
                                    <a target="_blank" href="/#/pages/property/listOwner?tab=业主信息" class="margin-left-xs">添加</a>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right">
                                    <vc:i18n name="开始时间" namespace="addLockPerson"></vc:i18n>
                                </label>
                                <div class="col-sm-4">
                                    <input v-model="addLockPersonInfo.startTime" type="text" :placeholder="vc.i18n('必填，请选择开始时间','addLockPerson')" class="form-control addStartTime">
                                </div>
                                <label class="col-sm-1 col-form-label text-right">
                                    <vc:i18n name="结束时间" namespace="addLockPerson"></vc:i18n>
                                </label>
                                <div class="col-sm-4">
                                    <input v-model="addLockPersonInfo.endTime" type="text" :placeholder="vc.i18n('必填，请选择结束时间','addLockPerson')" class="form-control addEndTime">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right">
                                    <vc:i18n name="开锁方式" namespace="addLockPerson"></vc:i18n>
                                </label>
                                <div class="col-sm-9">
                                    <select class="custom-select" v-model="addLockPersonInfo.openModel">
                                        <option selected disabled value="">{{vc.i18n('必填，请选择开锁方式','addLockPerson')}}</option>
                                        <option value="1001">{{vc.i18n('密码开锁','addLockPerson')}}</option>
                                        <option value="2002">{{vc.i18n('蓝牙开锁','addLockPerson')}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row" v-if="addLockPersonInfo.openModel === '1001'">
                                <label class="col-sm-2 col-form-label text-right">
                                    <vc:i18n name="密码" namespace="addLockPerson"></vc:i18n>
                                </label>
                                <div class="col-sm-9">
                                    <input v-model="addLockPersonInfo.cardNumber" type="text" :placeholder="vc.i18n('必填，请填写密码','addLockPerson')" class="form-control">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12 text-right">
                    <button type="button" class="btn btn-warning " style="margin-right:20px;" @click="vc.goBack()">
                        <vc:i18n name="取消" namespace="addLockPerson"></vc:i18n>
                    </button>
                    <button class="btn btn-primary" type="button" v-on:click="saveLockPersonInfo()">
                        <i class="fa fa-check"></i>&nbsp;提交
                    </button>
                </div>
            </div>
            <vc:create path="property/searchOwner" emitChooseOwner="addLockPerson" emitLoadData="addLockPerson"></vc:create>
        </div>
    </div>
</div>